<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/_geral.xhtml">

	<ui:define name="title">Login</ui:define>
	<ui:define name="titulo">Autenticação</ui:define>
	<ui:define name="conteudo">

		<f:event listener="#{autenticacaoBean.loginMsg}" type="preRenderView" />
		<p:messages autoUpdate="true" />

		<h:form>
			<p:panelGrid columns="2">
				<p:outputLabel for="email" value="E-mail:" />
				<p:inputText id="email" value="#{autenticacaoBean.email}"
					required="true" requiredMessage="O email é necessário">
					<p:ajax event="blur" />
				</p:inputText>

				<p:outputLabel for="senha" value="Senha:" />
				<p:password id="senha" required="true"
					requiredMessage="A senha é necessária"
					value="#{autenticacaoBean.senha}">
					<p:ajax event="blur" />
				</p:password>
				<p:commandButton action="#{autenticacaoBean.login()}" value="Login" />
			</p:panelGrid>
		</h:form>

	</ui:define>

</ui:composition>
</html>